<template>
  <div>
    <FormPanel
      ref="formPanel"
      :list="topFilterList"
      :cols="4"
      :labelWidth="90"
      formType="add"
      :isSubmitBtn="false"
      columnsRef="aassasdxkpjxscxTable"
      @formChange="searchAdjustOutboundEdit"
    ></FormPanel>
    <!-- <div class="confirm-button-style" style="text-align:center;">
       <el-button size="small" @click="queryClick" type="primary" :loading="addBtnState">查 询</el-button>
       <el-button size="small" @click="resetClick" type="primary" :loading="addBtnState">重 置</el-button>
    </div> -->
    <FilterTable
      ref="table"
      height="100px"
      :columns="columns"
      columnsRef="partPartOutboundAdjustOutboundAdjustOutboundEdit"
      :fetchapi="fetchApi"
      :params="fetchParams"
      :datakey="'rows'"
      :onColumnsChange="columns => (this.columns = columns)"
      :onRowSelectChange="arr => (this.onChangeColumn = arr)"
      selectionType="single"
    ></FilterTable>

    <div class="confirm-button-style" style="text-align:center;margin-top:20px;">
      <el-button @click="closeDialog">取 消</el-button>
      <el-button type="primary" :loading="addBtnState" @click="saveDialog">确 定</el-button>
    </div>
  </div>
</template>

<script>
import { dictionary } from '@/utils/dictMixin';
import { isAuthorized } from '@/utils/index';
import { queryAllocateInList } from '@/api/part/partOutbound/adjustOutbound/index';
export default {
  name: 'adjustOutboundEdit',
  mixins: [dictionary],
  data() {
    return {
      topFilterList: this.createTopFilterList(),
      columns: this.createTablelist(),
      fetchApi: {},
      fetchParams: {}
    };
  },
  mounted() {},
  methods: {
    createTopFilterList() {
      return [
        {
          type: 'SELECT',
          label: '仓库',
          fieldName: 'store',
          itemList: this.createDictList('1004')
        },
        {
          type: 'INPUT',
          label: '配件代码',
          fieldName: 'partCade',
          disabled: true
        },
        {
          type: 'INPUT',
          label: '配件名称',
          fieldName: 'partName'
        },
        {
          type: 'SELECT',
          label: '价格类型',
          fieldName: 'storeType',
          itemList: this.createDictList('1004')
          // itemList:[{ text: '是', value: 10571001 }, { text: '否', value: 0 }]
        },
        {
          type: 'INPUT',
          label: '价格系数',
          rules: [{ required: true, message: '请输入价格系数', trigger: 'blur' }],
          fieldName: 'priceRatio'
        },
        {
          type: 'INPUT',
          label: '出库单价',
          fieldName: 'outUnitPrice'
        },
        {
          type: 'INPUT',
          label: '出库数量',
          fieldName: 'outNumber'
        },
        {
          type: 'INPUT',
          label: '出库金额',
          disabled: true,
          fieldName: 'outPrice',
          disabled: true
        }
      ];
    },
    createTablelist() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '销售价',
          dataIndex: 'sellingPrice',
          sorter: true
        },
        {
          title: '索赔价',
          dataIndex: 'claimPrice',
          sorter: true,
          hidden: !isAuthorized('1313', '13131006')
        },
        {
          title: '终端建议零售价格',
          dataIndex: 'insurancePrice',
          sorter: true
        },
        {
          title: '最低销售限价',
          dataIndex: 'minLimitedPrice',
          sorter: true
        },
        {
          title: '销售限价',
          dataIndex: 'limitedPrice',
          sorter: true
        },
        {
          title: '建议销售价',
          dataIndex: 'marketingPrice',
          sorter: true
        },
        {
          title: '最大库存',
          dataIndex: 'maxInventory',
          sorter: true
        },
        {
          title: '最小库存',
          dataIndex: 'minInventory',
          sorter: true
        },
        {
          title: '账面库存',
          dataIndex: 'bookInventory',
          sorter: true
        },
        {
          title: '可用库存',
          dataIndex: 'availableInventory',
          sorter: true
        },
        {
          title: '借进数量',
          dataIndex: 'borrowNum',
          sorter: true
        },
        {
          title: '借出数量',
          dataIndex: 'lendNum',
          sorter: true
        },
        {
          title: '锁定量',
          dataIndex: 'lockingNum',
          sorter: true
        },
        {
          title: '替代配件',
          dataIndex: 'replacementParts',
          sorter: true
        },
        {
          title: '替代件库存',
          dataIndex: 'replacementInventory',
          sorter: true
        },
        {
          title: '配件类别',
          dataIndex: 'accessoriesCategory',
          sorter: true
        },
        {
          title: '单位',
          dataIndex: 'unit',
          sorter: true
        },
        {
          title: '配件车型组集',
          dataIndex: 'fittingsOfMachine',
          sorter: true
        }
      ];
    },
    searchAdjustOutboundEdit() {},
    //  确实
    saveDialog() {},
    //  点击取消关闭窗口
    closeDialog() {
      this.$emit('close', false);
    }
  }
};
</script>
<style lang="less" scoped></style>
